package lab01;

import java.util.Scanner;

public class Test08 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入您的数字： ");
        int guessNumber = (int) (Math.random() * 100);

        int count = 0;
        while (true) {
            count++;
            int resultNumber = sc.nextInt();
            if (resultNumber > guessNumber) {
                System.out.println("猜大了！");
            } else if (resultNumber < guessNumber) {
                System.out.println("猜小了！");
            } else {
                System.out.println("猜对了！");
                System.out.println("-------------------");
                System.out.println("您猜了" + count + "次");

            }


        }


    }

}
